* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 悬浮搜索框 */
.search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.search-box {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 30px 0 0 30px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-button {
    background: #ff4b5c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-button:hover {
    background: #ff2e4b;
}

/* 搜索结果区域 */
.results-info {
    margin: 20px 0;
    color: #666;
    font-size: 18px;
}

.results-count {
    font-weight: bold;
    color: #6a11cb;
}

.movies-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.movie-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.movie-poster {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.movie-year {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.movie-rating {
    display: flex;
    align-items: center;
    color: #ff4b5c;
    font-weight: bold;
}

.star {
    color: #ffc107;
    margin-right: 5px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .movies-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .search-input {
        padding: 10px 15px;
    }

    .search-button {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .movies-list {
        grid-template-columns: 1fr;
    }

    body {
        padding-top: 70px;
    }
}
.movie-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px;
    width: 200px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.movie-poster {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.05);
}

.play-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.play-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.movie-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    font-style: italic;
}

.movie-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.movie-meta span {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    background: #f0f0f0;
    color: #666;
}

.actor,
.director,
.type {
    font-size: 12px;
    color: #666;
    margin: 4px 0;
    line-height: 1.4;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

/* 修改电影列表布局 */
.movies-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    justify-content: center;
}

/* 调整电影卡片尺寸 */
.movie-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%; /* 改为100%宽度，由网格控制 */
    max-width: 220px; /* 最大宽度 */
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    cursor: pointer;
}

/* 调整海报容器高度 */
.movie-poster {
    position: relative;
    height: 250px; /* 减少高度 */
    overflow: hidden;
}

/* 调整信息区域 padding */
.movie-info {
    padding: 12px;
}

/* 调整标题字体大小 */
.movie-title {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 6px 0;
    color: #333;
    line-height: 1.3;
    height: 36px; /* 固定高度，防止文字溢出 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

/* 调整副标题 */
.movie-subtitle {
    font-size: 11px;
    color: #666;
    margin: 0 0 8px 0;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 调整元信息字体大小 */
.movie-meta span {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    background: #f0f0f0;
    color: #666;
}

/* 调整演员导演信息 */
.actor,
.director,
.type {
    font-size: 11px;
    color: #666;
    margin: 3px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 播放按钮调整 */
.play-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

/* 响应式设计调整 */
@media (max-width: 1200px) {
    .movies-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .movies-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .movie-poster {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .movies-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .movie-poster {
        height: 200px;
    }

    .movie-info {
        padding: 10px;
    }

    .movie-title {
        font-size: 13px;
        height: 32px;
    }
}

@media (max-width: 576px) {
    .movies-list {
        grid-template-columns: repeat(2, 1fr); /* 手机端显示2列 */
        gap: 10px;
    }

    .movie-poster {
        height: 180px;
    }
}

/* 确保容器充分利用空间 */
.container {
    max-width: 1400px; /* 增加最大宽度 */
    margin: 0 auto;
    padding: 20px;
}

/* 可选：添加滚动加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card {
    animation: fadeIn 0.5s ease-out;
}
